package com.zoweunion.mechanic.service.impl;

import com.zoweunion.mechanic.dao.ChannelPolicyDao;
import com.zoweunion.mechanic.service.ChannelPolicyService;
import com.zoweunion.mechanic.util.UuidUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("ChannelPolicyService")
public class ChannelPolicyServiceImpl implements ChannelPolicyService {
    @Autowired ChannelPolicyDao channelPolicyDao;

    @Override
    public int addChannelPolicy(Map<String, Object> params) {
        String id = UuidUtil.get32UUID();
        params.put("id", id);
        return channelPolicyDao.addChannelPolicy(params);
    }

    @Override
    public int editChannelPolicy(List<Map<String, Object>> list) {
        return channelPolicyDao.updateChannelPolicyById(list);
    }

    @Override
    public List<Map<String, Object>> selectChannelPolicyListBySid(Map<String, Object> params) {
        return channelPolicyDao.selectChannelPolicyListBySid(params);
    }

    @Override
    public int deleteChannelPolicyById(Map<String, Object> params) {
        return channelPolicyDao.deleteChannelPolicyById(params);
    }
}
